package ae.pcfc.etks.online.itworx.ehs.web.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;

@Entity
@Table(name = "T_EHS_OFC_DOCUMENT")
@SequenceGenerator(name = "EHS_OFC_DOCUMENT_ID_SEQ", sequenceName = "EHS_OFC_DOCUMENT_ID_SEQ", initialValue = 1, allocationSize = 1)
public class OFCDocument extends AuditableEntity implements Serializable {

	@Id
	@Column(name = "EHS_OFC_DOCUMET_ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EHS_OFC_DOCUMENT_ID_SEQ")
	private long id;
	@OneToOne
	@ForeignKey(name = "FK_OFC_DOCUMENT_DOCUMENT", inverseName = "FK_DOCUMENT_OFC_DOCUMENT")
	@JoinColumn(name = "EHS_DOCUMENT_TYPE_ID")
	private DocumentType documentType;
	@Lob
	@Column(name = "LOCATION", nullable = false)
	private String documentLocation;
	@Column(name = "NAME", nullable = false)
	private String documentName;
	
	public String getDocumentName() {
		return documentName;
	}

	public void setDocumentName(String documentName) {
		this.documentName = documentName;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public DocumentType getDocumentType() {
		return documentType;
	}

	public void setDocumentType(DocumentType documentType) {
		this.documentType = documentType;
	}

	public String getDocumentLocation() {
		return documentLocation;
	}

	public void setDocumentLocation(String documentLocation) {
		this.documentLocation = documentLocation;
	}

}
